Problem: What is the perimeter of the figure shown? [asy]

draw((0,0)--(0,2)--(1,2+sqrt(3))--(2,2)--(4,2)--(4,0)--(3,-sqrt(3))--(2,0)--cycle);

draw((-.2,1)--(.2,1));

draw((3.8,1)--(4.2,1));

draw((1,-.2)--(1,.2));

draw((3,1.8)--(3,2.2));

draw((0.15,0)--(0.15,0.15)--(0,0.15));

draw((3.85,2)--(3.85,1.85)--(4,1.85));

label("2",(4.1,1),E);

draw((.4,3.1)--(.7,2.9));

draw((1.6,3.1)--(1.3,2.9));

draw((3.6,-1.1)--(3.3,-.9));

draw((2.4,-1.1)--(2.7,-.9));

[/asy]
Answer: The figure has $8$ sides, each of equal length. Since the length of each side is $2,$ then the perimeter of the figure is $8\times 2 =\boxed{16}.$